<template>
    <div>
        <!--路径导航-->
       <el-breadcrumb separator-class="el-icon-arrow-right">
         <el-breadcrumb-item :to="{ path: '/users' }">首页</el-breadcrumb-item>
         <el-breadcrumb-item>活动管理</el-breadcrumb-item>
         <el-breadcrumb-item>活动列表</el-breadcrumb-item>
         <el-breadcrumb-item>活动详情</el-breadcrumb-item>
       </el-breadcrumb>
       <el-card :body-style="{ padding: '10px'}">
          <el-row :guter=4>
              <el-col :span=8>
                  <el-input placeholder="请输入内容"   v-model='queryInfo.query' :clearable='true' >
                      <el-button icon="el-icon-search" slot="append"></el-button>
                  </el-input>
              </el-col>
              <el-col :span=4>
                  <el-button type='primary' @click="toReport">添加</el-button>
              </el-col>
          </el-row>
          <el-table :border='true' :data="orderList">
          </el-table>
          <div class="block">
               <el-pagination
               @size-change="handleSizeChange"  
               @current-change="handleCurrentChange"
               :current-page="queryInfo.pagenum"
               :page-sizes="[1,2,3,6,10]"
               :page-size="queryInfo.pagesize"
                layout="total, sizes, prev, pager, next, jumper"
               :total="total">
               </el-pagination>
             </div>
      </el-card>
    </div>
    
</template>
<script>
export default {
    created(){
        this.getOrderList()
    },
    data(){
        return {
             orderList:[],
             queryInfo:{
                query:'',//查询条件
                pagenum:2,//第几页
                pagesize:1//每页显示的条数
            },
            total:0
        }
    },
    methods:{
       async getOrderList(){
           const {data:res}=await this.$http.get('orders',{params:this.queryInfo})
           console.log(res)
           if(res.meta.status!=200) return this.$message.error('获取数据失败')
           console.log(res)
        //    this.orderList=res.data
        //    this.total=res.data.total
       },
       handleSizeChange(){

       },
       handleCurrentChange(){

       },
       toReport(){
           this.$router.push('/reports')
       }
    }
}
</script>
<style lang="less">

</style>